# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from .utils import load_python_prompt


def instantiate_agent(args, strategy="audit", with_memory=False):
    if args.custom_prompt is not None:
        print(f">>>>>> custom_prompt enabled, {args.custom_prompt}")
        custom_prompt = load_python_prompt(args.custom_prompt)
    else:
        custom_prompt = None

    if strategy == "audit":
        from .strategy.audit import AuditAgent

        return AuditAgent(args, with_memory, custom_prompt=custom_prompt)
    else:
        raise ValueError(f"Agent strategy: {strategy} not supported!")
